package com.oa.hyperion.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.springframework.data.annotation.Id;

import javax.annotation.Generated;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

@Data
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
public class User implements Serializable {

   @TableId(type = IdType.AUTO)
    private Integer id;
   @NotBlank(message = "用户名不能为空")
   @Size(min = 3,message = "用户名的长度不得小于3位")
    private String account;
    @Size(min = 6,message = "密码长度不得小于3位")
    private  String password;
    @JsonFormat(shape =JsonFormat.Shape.STRING,pattern ="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    private Date createTime;
    @JsonFormat(shape =JsonFormat.Shape.STRING,pattern ="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    private Date lastLoginTime;
    private String lastLoginIp;
    @JsonIgnore
    private Integer passwordErrorCount;
    @JsonIgnore
    private Date lockTime;
    private String status;
}